{{- range $k, $hostGroup := . -}}
[{{$hostGroup.Name}}]
{{- range $hostGroup.Hosts}}
{{.Ipv4}} ansible_user={{.User.Username}} ansible_password="{{.User.Pwd}}" {{if .SuUser}}ansible_become_user={{.SuUser.Username}} {{if .SuUser.Method}}ansible_become_method={{.SuUser.Method}}{{end}} {{if .SuUser.Flags}}ansible_become_flags="{{.SuUser.Flags}}"{{end}} {{if .SuUser.Pwd}}ansible_become_password="{{.SuUser.Pwd}}"{{end}}{{end}}
{{- end }}

{{ end }}